﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DBO.Utility;
using System.ServiceModel;
using ClientDataAccess.PlayerServiceReference;
using ClientUtility;

namespace ClientDataAccess
{
    public class Session
    {
        public const string ServiceAddress = "http://localhost:17009/SessionService.svc";
        public static void OpenSession(PLICCredentials Creds)
        {
            WebHttpBinding binding = new WebHttpBinding();
            EndpointAddress address = new EndpointAddress(ServiceAddress);
            PlayerServiceReference.SOAPPlayerServiceClient Client = new PlayerServiceReference.SOAPPlayerServiceClient(binding, address);
            RequestResponse Resp = Client.OpenSession(Creds);

            if (Resp.ErrorMessage != "")
                throw new ClientException(Resp.ErrorMessage);

        }
    }
}
